package com.zhao.system.service.impl;

import com.zhao.system.poro.User;
import com.zhao.system.mapper.UserMapper;
import com.zhao.system.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaozhao
 * @since 2020-11-08
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User find(User user) {
        return userMapper.find(user);
    }

    @Override
    public User findbyname(String username) {
        return userMapper.findbyname(username);
    }

    @Override
    public int add(User user) {
        System.out.println(user);
//        int i = userMapper.add(user.getUsername(),user.getPassword());
        int i = userMapper.add(user);
        Integer id = user.getId();
        return id;

    }


}
